package edu.stanford.bmir.protege.web.client.rpc.stkosutil;



import java.util.List;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

import edu.stanford.bmir.protege.web.client.rpc.data.EntityData;
import edu.stanford.bmir.protege.web.client.rpc.data.PaginationData;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.common.SearchCondition;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.common.TripleData;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.common.UtilEntityType;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.cutter.CancelCutterResult;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.cutter.CuttingOptions;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.cutter.CuttingResult;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.cutter.RemoveEntityResult;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.cutter.actions.CancelCutterAction;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.enricher.CancelEnricherResult;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.enricher.CandidateEntity;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.enricher.EnrichmentOptions;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.enricher.EnrichmentResult;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.enricher.OriginEntity;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.enricher.SourceThesaurus;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.enricher.actions.CancelEnricherAction;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.enricher.actions.CreateCandidateClassesAction;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.enricher.actions.CreateCandidateClassesResult;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.enricher.actions.CreateTriplesAction;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.enricher.actions.CreateTriplesResult;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.mapper.CancelMapperResult;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.mapper.MappingOptions;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.mapper.MappingResult;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.mapper.actions.CancelMapperAction;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.merger.CancelMergerResult;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.merger.MergenceOptions;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.merger.MergenceResult;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.merger.actions.CancelMergerAction;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.merger.actions.MergeEntityAction;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.merger.actions.MergeEntityResult;
import edu.stanford.bmir.protege.web.client.rpc.stkosutil.statistics.StatisticsResult;


@RemoteServiceRelativePath("stkosutil")
public interface StkosUtilService extends RemoteService{
	public String addAnnotaionValue(String projectName, String entityName, String annotaionName, String annotaionValue);
	public void updateAnnotaionValue(String projectName, String entityName, UtilEntityType entityType, String annotaionName, String annotaionValue);
	public Integer removeAnnotationValue(String projectName, String entityName, UtilEntityType entityType, String annotationName, String annotationValuePattern);
	
	public PaginationData<EntityData> search(String projectName, SearchCondition searchCondition,  int start, int limit, String sort, String dir);
	public List<EntityData> search(String projectName, SearchCondition searchCondition);

	
	public MappingResult mapOntologies(String project1Name, String project2Name, MappingOptions options);
	
	public CuttingResult cutOntology(String projectName, CuttingOptions options);
	public RemoveEntityResult removeCutEntities(String projectName);
	public List<SourceThesaurus> fetchSourceThesaurusList();
	public List<CandidateEntity> fetchCandidateEntities(String projectName, OriginEntity originEntity, EnrichmentOptions options);
	public List<TripleData> fetchCandidateTriples(String projectName, OriginEntity originEntity, EnrichmentOptions options);
	public EnrichmentResult enrichOntology(String projectName, EnrichmentOptions options);
	public CreateCandidateClassesResult createCandidateClasses(String projectName, CreateCandidateClassesAction action);
	public CreateTriplesResult createTriples(String projectName, CreateTriplesAction action);
	
	public MergenceResult mergeOntology(String projectName, MergenceOptions options);
	public MergeEntityResult mergeEntity(String projectName, MergeEntityAction action);
	
	public StatisticsResult countEntities(String projectName);
	
	/**
	 * cancel merger
	 * 
	 * @param projectName
	 *            The operation project`s name.
	 * @param action
	 *            The cancel action.
	 * @param callback
	 *            The callback function.
	 */
	public CancelMergerResult cancelMerger(String projectName, CancelMergerAction action);
	/**
	 * cancel enricher
	 * 
	 * @param projectName
	 *            The operation project`s name.
	 * @param action
	 *            The cancel action.
	 * @param callback
	 *            The callback function.
	 */
	public CancelEnricherResult cancelEnricher(String projectName, CancelEnricherAction action);
	/**
	 * cancel cutter
	 * 
	 * @param projectName
	 *            The operation project`s name.
	 * @param action
	 *            The cancel action.
	 * @param callback
	 *            The callback function.
	 */
	public CancelCutterResult cancelCutter(String projectName, CancelCutterAction action);
	/**
	 * cancel mapper
	 * 
	 * @param projectName
	 *            The operation project`s name.
	 * @param action
	 *            The cancel action.
	 * @param callback
	 *            The callback function.
	 */
	public CancelMapperResult cancelMapper(String projectName, CancelMapperAction action);
}
 